<script setup lang="ts">
import { useUserStore } from '@/stores/user';
import { computed } from 'vue';

const props =  withDefaults(defineProps<{
  btnPerm?: string
}>(), {
  btnPerm: ''
})

const store = useUserStore()
const permissions = store.profile.permissions
const isShow = computed(()=>{
  if(permissions.includes(props.btnPerm) || permissions.includes('*:*:*')){
    return true
  } else {
    return false
  }
})
</script>

<template>
  <slot v-if="isShow"></slot>
  <span v-else></span>
</template>

